<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> - 基本表单</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="../favicon.ico">
    <link href="/Public/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link rel="stylesheet" href="/Public/css/ace.min.css" />
    <link href="/Public/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/Public/css/animate.css" rel="stylesheet">
    <link href="/Public/css/style.css?v=4.1.0" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="/Public/admin/css/gxxj/normalize.css">

    <style type="text/css">
        .span_right{
            float: right;
        }
        .down-menu{
            height: 35px;
            line-height: 35px;
        }
        .search_div{
            background: none;
            border: none;
            width: 450px !important;
        }
        .m-search{
            display: flex;
            margin-left: 30px;
        }
        .col-sm-2 {
            width: 28%;
        }
        .modal {
            position: fixed;
            top: 200px;
            right: 0;
            bottom: 0;
            left: 0;
            z-index: 1050;
            display: none;
            overflow: hidden;
            -webkit-overflow-scrolling: touch;
            outline: 0;
        }
    </style>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>用户信息-
                        <small>用户列表</small>
                    </h5>
                    <div class="ibox-tools">
                        <form method="get" action="<{$SRVER_NAME}>/admin.php/UserInfo/user_list_info"  style="display: flex;   margin-right: 30px;" class="pull-right mail-search">
                            <div class="m-search" style="display: flex">
                                <input type="hidden" name="rid" value="<{$rid}>">
                                  <input  class="form-control input-sm" type="text" name="user" placeholder="搜索用户" value="<{$user_content}>"/>
                                <div class="input-group-btn">
                                    <button type="submit" class="btn btn-sm btn-primary">
                                        搜索
                                    </button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="ibox-content">

                    <table class="table table-striped table-bordered table-hover" id="sample-table">
                        <thead>
                        <tr>
                            <th>账号</th>
                            <th>用户名</th>
                            <th>认证状态</th>
                            <th>身份证号码</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <volist name="user" id="vo" >

                            <tr id="tr_<{$vo.id}>">
                                <td><{$vo.mobile}></td>
                                <td><{$vo.truename}></td>
                                <td><{$vo.cert_status}></td>
                                <td><{$vo.id_card1}></td>
                                <td>
                                    <volist name="roles" id="vr">

                                        <if condition="$vr['name'] eq '修改资料'">
                                            <a class="btn btn-danger btn-rounded" href="javascript:;"  data-toggle="modal" data-target="#myModal" onclick="editUserInfo('<{$vo.vid}>','<{$vo.truename}>','<{$vo.id_card}>')">修改资料</a>
                                        </if>
                                        <if condition="$vr['name'] eq '查看详情'">
                                            <a href="<{$SRVER_NAME}>/admin.php/UserInfo/user_list_details?vid=<{$vo.vid}>&user_content=<{$user_content}>&user_type=1&page=<{$page}>&rid=<{$rid}>"  class="btn btn-success btn-rounded">查看详情</a>

                                        </if>

                                    </volist>

                                </td>
                            </tr>
                        </volist>
                        </tbody>
                    </table>
                    <div class="dataTables_paginate paging_simple_numbers" >
                        <ul class="pagination">
                            <if condition="$tol gt 10">
                                <{$fpage}>
                            </if>

                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">修改资料</h4>
            </div>
            <div class="modal-body">
                <li style="display: flex">
                    <label class="col-sm-2 control-label">修改姓名</label>
                    <input type="text" class="form-control" id="name_show"  name="name_show" value="" >
                </li>
                <br>
                <li style="display: flex">
                    <label class="col-sm-2 control-label">修改身份证号</label>
                    <input type="text" class="form-control" id="card_show" name="card_show" value="">
                </li>
            </div>
            <input type="hidden" id="vid_val" />
            <input type="submit" class="submit_editPwd" onclick="user_edit()" value="确 认">
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

<script src="/Public/js/jquery.min.js?v=2.1.4"></script>
<script src="/Public/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/Public/js/content.js?v=1.0.0"></script>
<script src="/Public/admin/js/common1.js"></script>
<script src="/Public/admin/js/layer/layer.js"></script>
<script src="/Public/admin/js/layui/layui.js"></script>
<script type="text/javascript">

    function editUserInfo(vid,name,card) {
        $("#vid_val").val(vid);
        $("#name_show").val(name);
        $("#card_show").val(card);
    }

    function user_edit() {

        var index = layer.load(1, {
            shade: [0.1, '#fff'] //0.1透明度的白色背景
        });
        var vid= $("#vid_val").val()
        var name=$("#name_show").val();
        var card=$("#card_show").val();
        var url= "<{$SRVER_NAME}>/admin.php/UserInfo/user_edit";
        var tourl= "<{$SRVER_NAME}>/admin.php/UserInfo/user_list_info";
        if(name=="" || card==""){
            layer.close(index);
            layer.alert("请信息填写完整！\r\n", {
                title: '提示框',
                icon: 0,
            });
            return false;
        }

        layer.alert("确定修改？", {title: '提示框', icon: 1}, function () {

            $.post(url, {vid: vid, name:name,card:card}, function (data) {
                if (data.code == "1001") {
                    layer.alert(data.result, {title: '提示框', icon: 1}, function () {
                        window.location.href =  "";
                        layer.close(index);
                    });
                }
                else {
                    layer.alert(data.result, {title: '提示框', icon: 2});
                    layer.close(index);
                }

            });
            layer.close(index);
        });



    }
</script>

    </body>
</html>
